package com.avalon.erp.sys.addon.project.service;

import org.springframework.stereotype.Service;

import com.avalon.core.field.Field;
import com.avalon.core.field.Fields;
import com.avalon.core.service.AbstractService;
import com.avalon.core.model.SelectionHashMap;

import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class ProjectMemberService extends AbstractService {
    @Override
    public String getServiceName() {
        return "project.member";
    }

    @Override
    public String getLabel() {
        return "项目成员";
    }

    @Override
    public Field getNameField() {
        return Fields.createRelatedField("项目成员", "userId.name");
    }

    public Field projectId = Fields.createMany2one("项目",
            "project.project");
    public Field userId = Fields.createMany2one("成员",
            "base.user");
    public Field role = Fields.createSelection("角色",
            new SelectionHashMap() {
                {
                    put("admin", "管理员");
                    put("developer", "开发人员");
                    put("designer", "设计师");
                    put("tester", "测试人员");
                    put("product", "产品经理");
                    put("projectManager", "项目经理");
                    put("other", "其他");
                    put("member", "干系人");
                }
            });
}
